#! /bin/bash

echo "开始执行运行脚本"

#BUILD_ID=dontKillMe
pid=`ps -ef | grep meitu-api-0.0.1-SNAPSHOT.jar  | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
   echo "kill -9 的pid:" $pid
   kill -9 $pid
fi
echo "kill java 进程"

rm -rf meitu-api-0.0.1-SNAPSHOT.jar
echo "rm jar"


mv new/meitu-api-0.0.1-SNAPSHOT.jar .
chmod +x meitu-api-0.0.1-SNAPSHOT.jar
echo "mv jar"

nohup java -jar meitu-api-0.0.1-SNAPSHOT.jar  > meitu.log 2>&1 &
echo "java start..."